<?php /* Smarty version 2.6.20, created on 2016-07-21 14:41:37
         compiled from change_tree.htm */ ?>
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery.ui.js"></script>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/Validator.js"></script>
<div class="container">
<div>
<input name="act" type="hidden" id="act" value="change_tree">
<table class="table">
    <thead>
        <tr>
            <th class="partition" colspan="99">更改关系</th>
        </tr>
    </thead>
    <tbody>
    <tr>
    	<td>要变更的会员：</td>
        <td>
        	<input type="text" name="member_id" id="member_id" placeholder="会员ID" />
       	</td>
    </tr>
    <tr>
       	<td>绑定到某会员：</td>
        <td>
        	<input type="text" name="d_member_id" id="d_member_id" placeholder="会员ID" />
       	</td>
    </tr>
    <tr>
    	<td>是否给被绑定的人发推广红包：</td>
        <td>
        	<input type="radio" name="give_bonus" value="1" id="yes" /><label for="yes">是</label><input type="radio" name="give_bonus" value="0" id="no" checked/><label for="no">否</label>
       	</td>
    </tr>
    </tbody>
</table>
<div class="dialog_button">
    <input id="save" type="button" value="确认">
</div>
<script>
$(function(){
	//确认更改
	$("#save").click(function () {
		var member_id = $('#member_id').val();
		var d_member_id = $('#d_member_id').val();
		var act = $('#act').val();
		var give_bonus = 0;
		if($("input[name=give_bonus][value='1']").attr('checked')==true){
			give_bonus = 1;
		}
		$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=change_tree.php',{"member_id":member_id,"d_member_id":d_member_id,"give_bonus":give_bonus,"act":act},function(res){
			if(res.code!=0){
				alert(res.msg);
			}else{
			    window.parent.main.document.location.reload();
			    window.parent.DialogManager.close("change_tree");
			}
		},'json');
	    return false;
	});
});
</script>
</div>
</div>